﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TightVNCTool
{
    public partial class Form2 : Form
    {
        private readonly VncItem vncItem;


        public Form2(VncItem vncItem)
        {
            InitializeComponent();
            this.vncItem = vncItem;
            textBox_host.Text = vncItem.Host;
            textBox_pwd.Text = vncItem._password;
            textBox_info.Text = vncItem.Description;
        }

        public Action<VncItem>? SaveClick { get; set; }
        private void Button1_Click(object sender, EventArgs e)
        {
            vncItem.Host = textBox_host.Text;
            vncItem._password = textBox_pwd.Text;
            vncItem.Description = textBox_info.Text;
            SaveClick?.Invoke(vncItem);
        }
    }
}
